home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libgtop.idb / usr / freeware / include / glibtop / prockernel.h.z / prockernel.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  3.0 KB  |  99 lines

  1. /* $Id: prockernel.h,v 1.14 1999/02/23 11:43:04 martin Exp $ */
  2.  
  3. /* Copyright (C) 1998-99 Martin Baulig
  4.    This file is part of LibGTop 1.0.
  5.  
  6.    Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
  7.  
  8.    LibGTop is free software; you can redistribute it and/or modify it
  9.    under the terms of the GNU General Public License as published by
  10.    the Free Software Foundation; either version 2 of the License,
  11.    or (at your option) any later version.
  12.  
  13.    LibGTop is distributed in the hope that it will be useful, but WITHOUT
  14.    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16.    for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with LibGTop; see the file COPYING. If not, write to the
  20.    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.    Boston, MA 02111-1307, USA.
  22. */
  23.  
  24. #ifndef __GLIBTOP_PROCKERNEL_H__
  25. #define __GLIBTOP_PROCKERNEL_H__
  26.  
  27. #include <glibtop.h>
  28. #include <glibtop/global.h>
  29.  
  30. BEGIN_LIBGTOP_DECLS
  31.  
  32. #define GLIBTOP_PROC_KERNEL_K_FLAGS    0
  33. #define GLIBTOP_PROC_KERNEL_MIN_FLT    1
  34. #define GLIBTOP_PROC_KERNEL_MAJ_FLT    2
  35. #define GLIBTOP_PROC_KERNEL_CMIN_FLT    3
  36. #define GLIBTOP_PROC_KERNEL_CMAJ_FLT    4
  37. #define GLIBTOP_PROC_KERNEL_KSTK_ESP    5
  38. #define GLIBTOP_PROC_KERNEL_KSTK_EIP    6
  39. #define GLIBTOP_PROC_KERNEL_NWCHAN    7
  40. #define GLIBTOP_PROC_KERNEL_WCHAN    8
  41.  
  42. #define GLIBTOP_MAX_PROC_KERNEL        9
  43.  
  44. typedef struct _glibtop_proc_kernel    glibtop_proc_kernel;
  45.  
  46. /* Kernel stuff */
  47.  
  48. struct _glibtop_proc_kernel
  49. {
  50.     u_int64_t flags;
  51.     u_int64_t k_flags,    /* kernel flags for the process */
  52.         min_flt,    /* number of minor page faults since
  53.                  * process start */
  54.         maj_flt,    /* number of major page faults since
  55.                  * process start */
  56.         cmin_flt,    /* cumulative min_flt of process and
  57.                  * child processes */
  58.         cmaj_flt,    /* cumulative maj_flt of process and
  59.                  * child processes */
  60.         kstk_esp,    /* kernel stack pointer */
  61.         kstk_eip,    /* kernel stack pointer */
  62.         nwchan;        /* address of kernel wait channel
  63.                  * proc is sleeping in */
  64.     char wchan [40];
  65. };
  66.  
  67. #define glibtop_get_proc_kernel(p1, p2)    glibtop_get_proc_kernel_l(glibtop_global_server, p1, p2)
  68.  
  69. #if GLIBTOP_SUID_PROC_KERNEL
  70. #define glibtop_get_proc_kernel_r    glibtop_get_proc_kernel_p
  71. #else
  72. #define glibtop_get_proc_kernel_r    glibtop_get_proc_kernel_s
  73. #endif
  74.  
  75. void glibtop_get_proc_kernel_l (glibtop *server, glibtop_proc_kernel *buf, pid_t pid);
  76.  
  77. #if GLIBTOP_SUID_PROC_KERNEL
  78. void glibtop_init_proc_kernel_p (glibtop *server);
  79. void glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, pid_t pid);
  80. #else
  81. void glibtop_init_proc_kernel_s (glibtop *server);
  82. void glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid);
  83. #endif
  84.  
  85. #ifdef GLIBTOP_NAMES
  86.  
  87. /* You need to link with -lgtop_names to get this stuff here. */
  88.  
  89. extern const char *glibtop_names_proc_kernel [];
  90. extern const unsigned glibtop_types_proc_kernel [];
  91. extern const char *glibtop_labels_proc_kernel [];
  92. extern const char *glibtop_descriptions_proc_kernel [];
  93.  
  94. #endif
  95.  
  96. END_LIBGTOP_DECLS
  97.  
  98. #endif
  99.